/**
 * Created by cjsvaxlp on 2017/11/24.
 */
function loadTransmitterData( data){
    var dataId=$('.effective');
    $.each(dataId,function(a,b){
        var transmitterPowerData = data[$(b).attr('data-id')][$(b).attr('data-gro-id')]['38']||data[$(b).attr('data-id')][$(b).attr('data-gro-id')]['42']||data[$(b).attr('data-id')][$(b).attr('data-gro-id')]['45'];
        var exciterStatus1 = data[$(b).attr('data-id')][$(b).attr('data-gro-id')]['38']||data[$(b).attr('data-id')][$(b).attr('data-gro-id')]['46']||data[$(b).attr('data-id')][$(b).attr('data-gro-id')]['43'];
        var exciterStatus2 = data[$(b).attr('data-id')][$(b).attr('data-gro-id')]['38'];
        var humitureStatus = data[$(b).attr('data-id')][$(b).attr('data-gro-id')]['41']||data[$(b).attr('data-id')][$(b).attr('data-gro-id')]['44']||data[$(b).attr('data-id')][$(b).attr('data-gro-id')]['47'];
        $.each(transmitterPowerData,function(i,n){
            if(transmitterPowerData){
                if(i=='tt_ou_pw'){
                    if(n==''){
                        $(b).find('.transmittedPower span').text("----");
                        $(b).find('.transmittedPower i').removeClass('text-green').addClass('text-gray-Light')
                    }else{
                        $(b).find('.transmittedPower span').text(n+'W');
                        $(b).find('.transmittedPower i').removeClass('text-gray-Light').addClass('text-green')
                    }
                }
                if(i=='tt_rf_pw'){
                    if(n==''){
                        $(b).find('.reflectedPower span').text('----');
                        $(b).find('.reflectedPower i').removeClass('text-green').addClass('text-gray-Light')
                    }else{
                        $(b).find('.reflectedPower span').text(n+'W');
                        $(b).find('.reflectedPower i').removeClass('text-gray-Light').addClass('text-green')
                    }
                }
            }
        });
        if(exciterStatus1&&JSON.stringify(exciterStatus1) != "{}"){
            $(b).find('.deviceStatus span').first().addClass('label-success').removeClass('label-danger label-default');
        }else{
            $(b).find('.deviceStatus span').first().addClass('label-default').removeClass('label-danger label-success');
        }
        if(exciterStatus2&&JSON.stringify(exciterStatus2) != "{}"){
            $(b).find('.deviceStatus span:eq(1)').addClass('label-success').removeClass('label-danger label-default');
        }else{
            $(b).find('.deviceStatus span:eq(1)').addClass('label-default').removeClass('label-danger label-success');
        }
        if(humitureStatus&&JSON.stringify(humitureStatus) != "{}"){
            $(b).find('.deviceStatus span').last().addClass('label-success').removeClass('label-danger label-default');
        }else{
            $(b).find('.deviceStatus span').last().addClass('label-default').removeClass('label-danger label-success');
        }
    });
}